<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%-- 引入页面头 --%>
<%@ include file="/pageHead.jsp"%>
<form id="form2" name="form2">
	<input type="hidden" name="userid" id="userid" value="${user.id}">
</form>
<form name="form1" id="form1" action="<%-- ${systemctx}/sample/saveSample.web --%>" method="post">
	<div class="pageMain">
		<div class="pageTitle">
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.bascsetting.title") %>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.title.check") %>
			<span></span>
			<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.manage.check.title") %>
		</div>
		<div class="pageBody">
			<div class="form-group">
			</div>	
		</div>
		<div class="button-group">
			<input type="button" class="btn btn-default" onclick="check()" value="<%=MessageResourcesUtils.getMessage(request, "common.button.check") %>" />
			<input type="button" class="btn btn-default" id="butReturn" name="butReturn" value='<%=MessageResourcesUtils.getMessage(request, "common.button.back")%>' />
		</div>
		<table width="100%">
			<tbody>
				<tr>
					<td>
						<table id="datagrid"></table>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</form>
<script type="text/javascript">
	function check(){
		var userid = $("#userid").val();
		if(confirm('<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.message.confirm.checkinfo")%>')){
			// 显示进度条
			showSending();
			$.ajax({
				type : 'GET',
				url : '${systemctx}/systemmanage/userDuty/check.json?userid='+userid,
				dataType : 'json',
				success : function(data) {
					//关闭执行...
					closeSending();
					if(data.messagetype == 1){//复核成功
						//显示AJAX请求后的提示信息
						$.fn.ajaxmessage(data);
						window.location.href = "${systemctx}/systemmanage/userDuty/user/checkList.web";
					}else{//复核失败
						$.fn.ajaxmessage(data);//打印信息
					}
				}
			});
		}
	}


	$(document).ready(function() {
		var userid = $("#userid").val();
		$('#butReturn').click(function() {
			parent.document.location.reload();
			$.fn.closeIssWindow();
		});
		//加载分页控件 datagrid
		$('#datagrid').issdatagrid({
			formid : 'form1',
			title : '<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.manage.check.title") %>',
			width : 'auto',
			nowrap : true,
			autoRowHeight : false,
			singleSelect : false,
			striped : true,
			url : '${systemctx}/systemmanage/userDuty/queryCheckDutyListInfoDataGrid.json?userid='+userid,
			sortName: 'modifytime',
			sortOrder: 'desc',
			remoteSort : true,
			idField : 'dutyid',
			pagination : true,
			rownumbers : true,
			showFooter : true,
			queryParams:$('#form1').serializeObject(),
			columns : [ [ 
				{title : '<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.column.dutycode") %>',field : 'dutycode',sortable : true,align : 'left',width:140}, 
				{title : '<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.column.dutyname") %>',field : 'dutyname',sortable : true,align : 'left',width:140}, 
				{title : '<%=MessageResourcesUtils.getMessage(request, "systemmanage.userduty.column.dutycheckstatus") %>',field : 'dutycheckstatus',width : 100, sortable : true, align : 'center'}, 
				{field : 'dutyid',hidden:true} 
			] ],
			onLoadSuccess : function(data) {

			}
		});

		$('#butQuery').click(function() {
			$('#datagrid').datagrid('load',$('#form1').serializeObject());
		});
	
	});
</script>
<%-- 引入页面尾 --%>
<%@ include file="/pageFloor.jsp"%>